package wxdgaming.game.server.bean.ai;

import lombok.Getter;
import wxdgaming.boot2.core.collection.MapOf;

import java.util.Map;

/**
 * @author wxd-gaming(無心道, 15388152619)
 * @version 2025-10-23 19:41
 **/
@Getter
public enum AiType {
    Idle(1, AiAction.Idle, "休息"),
    FindPath(2, AiAction.FindPath, "寻路"),
    Move(3, AiAction.Move, "移动"),
    PathMove(4, AiAction.Move, "按照路径点寻路"),
    UseSkill(5, AiAction.UseSkill, "使用技能"),
    FindSkillTarget(6, AiAction.UseSkill, "寻找技能作用目标"),
    ;

    private static final Map<Integer, AiType> static_map = MapOf.ofMap(AiType::getCode, AiType.values());

    public static AiType of(int value) {
        return static_map.get(value);
    }

    public static AiType ofOrException(int value) {
        AiType tmp = static_map.get(value);
        if (tmp == null) throw new RuntimeException("查找失败 " + value);
        return tmp;
    }

    private final int code;
    private final AiAction aiAction;
    private final String comment;

    AiType(int code, AiAction aiAction, String comment) {
        this.code = code;
        this.aiAction = aiAction;
        this.comment = comment;
    }

}